home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM20_B.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  99 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM20_B.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   set_handle_name                                         ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function assigns an eight-character name to a      ;
  7. ;                     handle.  There is no restriction on the characters      ;
  8. ;                     which may be used in the handle name (may be            ;
  9. ;                     00h through FFh).                                       ;
  10. ;                                                                             ;
  11. ;                     At installation, all handles have their names           ;
  12. ;                     initialized to ASCII nulls (binary zeros).  By          ;
  13. ;                     definition, a handle thus initialized has no name.      ;
  14. ;                     To name a handle, make at least one character in        ;
  15. ;                     the name a non-null character (to distinguish it from   ;
  16. ;                     a handle without a name.)  No two handles may have      ;
  17. ;                     the same name.                                          ;
  18. ;                                                                             ;
  19. ;                     A handle can be renamed at any time by setting its      ;
  20. ;                     name to a new value.  A handle can have its name        ;
  21. ;                     removed by setting the name to all ASCII nulls.         ;
  22. ;                     When a handle is deallocated, its name is removed       ;
  23. ;                     (set to ASCII nulls).                                   ;
  24. ;                                                                             ;
  25. ;           PASSED:   &handle_name:                                           ;
  26. ;                        is a far pointer to a structure containing the       ;
  27. ;                        name that is to be assigned to the handle.  The      ;
  28. ;                        structure member is described here:                  ;
  29. ;                                                                             ;
  30. ;                        name:                                                ;
  31. ;                           is an array of chars that holds the handle's      ;
  32. ;                           name.  If the handle's name is less than eight    ;
  33. ;                           characters long, you must add nulls to make it    ;
  34. ;                           eight characters.                                 ;
  35. ;                                                                             ;
  36. ;                     handle:                                                 ;
  37. ;                        is the handle to which the name is to be assigned.   ;
  38. ;                                                                             ;
  39. ;         RETURNED:   status:                                                 ;
  40. ;                        is the status EMM returns from the call.  All other  ;
  41. ;                        returned results are valid only if the status        ;
  42. ;                        returned is zero.  Otherwise they are undefined.     ;
  43. ;                                                                             ;
  44. ; C USE CONVENTION:   unsigned int       status;                              ;
  45. ;                     unsigned int       handle;                              ;
  46. ;                     HANDLE_NAME_STRUCT handle_name;                         ;
  47. ;                                                                             ;
  48. ;                     status = set_handle_name (&hn,                          ;
  49. ;                                               handle);                      ;
  50. ;-----------------------------------------------------------------------------;
  51. .XLIST
  52. PAGE    60,132
  53.  
  54. IFDEF SMALL
  55.    .MODEL SMALL, C
  56. ENDIF
  57. IFDEF MEDIUM
  58.    .MODEL MEDIUM, C
  59. ENDIF
  60. IFDEF LARGE
  61.    .MODEL LARGE, C
  62. ENDIF
  63. IFDEF COMPACT
  64.    .MODEL COMPACT, C
  65. ENDIF
  66. IFDEF HUGE
  67.    .MODEL HUGE, C
  68. ENDIF
  69.  
  70. INCLUDE emmlib.equ
  71. INCLUDE emmlib.str
  72. INCLUDE emmlib.mac
  73. .LIST
  74. .CODE
  75.  
  76. set_handle_name        PROC                                                  \
  77.             USES DS SI,                                           \
  78.             ptr_handle_name:FAR PTR BYTE,                             \
  79.             handle:WORD
  80.  
  81.     ;---------------------------------------------------------------------;
  82.     ;   do;                                                               ;
  83.     ;   .   set the current name of the specified handle;                 ;
  84.     ;---------------------------------------------------------------------;
  85.     MOVE        AX, set_handle_name_fcn
  86.     MOVE        DX, handle
  87.     MOVE        DS:SI, ptr_handle_name
  88.     INT         EMM_int
  89.  
  90.     ;---------------------------------------------------------------------;
  91.     ;   .   return (EMM status);                                          ;
  92.     ;   end;                                                              ;
  93.     ;---------------------------------------------------------------------;
  94.     RET_EMM_STAT    AH
  95.  
  96. set_handle_name        ENDP
  97.  
  98. END
  99.